﻿<?php 
include("conexion.php");
$codigo=$_POST['idusu'];

$consulta=mysql_query("SELECT * from usuarios where idusuario='$codigo'", $conn) or die(mysql_error());

$row = mysql_fetch_array($consulta);

$sql=mysql_query("SELECT * FROM cargousu",$conn);
$sql2=mysql_query("SELECT * FROM ubigeo",$conn);

?>

<form id="frmeditusu" name="frmeditusu" method="post" action="grabar_editusu.php">
  <table width="305" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="38" colspan="2"><span class="editcam">Editar Usuario
        <label>
        <input type="hidden" name="idusuario" value="<?php echo $row['idusuario']; ?>" id="idusuario" />
        </label>
      </span></td>
    </tr>
    <tr>
      <td width="108" height="25"><span class="editcampp">Usuario : </span></td>
      <td width="197" height="25"><input type="text" style="background:#FFFFFF; text-transform:uppercase; " name="loginusuario" id="loginusuario" readonly="readonly" value="<?php echo $row['loginusuario']; ?>" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">Ape. Paterno : </span></td>
      <td height="25"><input type="text" style="background:#FFFFFF; text-transform:uppercase; border:#CCCCCC;" name="apepat" id="apepat" value="<?php echo $row['apepat']; ?>" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">Ape. Materno : </span></td>
      <td height="25"><input type="text" value="<?php echo $row['apemat']; ?>" style="background:#FFFFFF;text-transform:uppercase;" name="apemat" id="apemat" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">1º Nombre</span><span class="editcampos"> : </span></td>
      <td height="25"><input type="text" value="<?php echo $row['prinom']; ?>" style="background:#FFFFFF;text-transform:uppercase;" name="prinom" id="prinom" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">2º Nombre : </span></td>
      <td height="25"><input type="text" value="<?php echo $row['segnom']; ?>" style="background:#FFFFFF;text-transform:uppercase" name="segnom" id="segnom" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">Fecha de Naci. : </span></td>
      <td height="25"><input name="fecnac" value="<?php echo $row['fecnac']; ?>" style="background:#FFFFFF" type="text" id="fecnac" size="12" class="tcal" maxlength="10" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">Domicilio :</span></td>
      <td height="25"><input type="text" value="<?php echo $row['domicilio']; ?>" style="background:#FFFFFF; text-transform:uppercase"  name="domicilio" id="domicilio" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">Teléfono : </span></td>
      <td height="25"><input name="telefono" value="<?php echo $row['telefono']; ?>" style="background:#FFFFFF" type="text" id="telefono" size="15" /></td>
    </tr>
    <tr>
      <td height="25"><span class="editcampp">Cargo : </span></td>
      <td height="25"><select name="idcargo" id="idcargo">
      <option value="<?php echo $row['idcargo']; ?>" selected="selected">
      <?php 
	  $car=$row['idcargo'];
	  $sql6=mysql_query("SELECT * FROM cargousu WHERE idcargo='$car'",$conn)  or die(mysql_error());
      $row6 = mysql_fetch_array($sql6);
	  echo $row6['descargo'];
	  
	   ?>
      </option>
        <?php
	       while($row2 = mysql_fetch_array($sql)){
	         echo "<option value=".$row2['idcargo'].">".$row2['descargo']."</option> \n";
             }
	     ?>
      </select></td>
    </tr>
    <tr>
      <td height="31">&nbsp;</td>
      <td height="31"><label>
        <input type="submit" name="button" id="button" value="Grabar" />
      </label></td>
    </tr>
  </table>
</form>
